import Router from 'koa-router'

import DlyMenuController from '../controller/dlyadmin/menuController'

const router = new Router()

router.prefix('/dlyadminapi/menu')

router
	/**
	 * @swagger
	 * /dlyadminapi/menu/add:
	 *   post:
	 *     description: 新增菜单
	 *     tags: [后台用户]
	 *     summary: "新增菜单"
	 *     parameters:
	 *     produces:
	 *       - application/json
	 *     responses:
	 *       200:
	 *         description: 获取数据列表
	 * */
	.post('/add', DlyMenuController.add)

    /**
	 * @swagger
	 * /dlyadminapi/menu/list:
	 *   get:
	 *     description: 获取菜单列表
	 *     tags: [后台用户]
	 *     summary: "获取菜单列表"
	 *     parameters:
	 *     produces:
	 *       - application/json
	 *     responses:
	 *       200:
	 *         description: 获取数据列表
	 * */
    .get('/list', DlyMenuController.list)
    /**
	 * @swagger
	 * /dlyadminapi/menu/update:
	 *   put:
	 *     description: 编辑菜单
	 *     tags: [后台用户]
	 *     summary: "编辑菜单"
	 *     parameters:
	 *     produces:
	 *       - application/json
	 *     responses:
	 *       200:
	 *         description: 获取数据列表
	 * */
    .put('/update', DlyMenuController.update)

    .delete('/deleted', DlyMenuController.deleted)
    // 获取当前用户的路由权限列表
    .get('/getCurrentUserPermissions', DlyMenuController.getCurrentUserPermissions)
    /**
	 * @swagger
	 * /dlyadminapi/menu/addShopWhite:
	 *   post:
	 *     description: 添加店铺白名单
	 *     tags: [后台用户]
	 *     summary: "添加店铺白名单"
	 *     parameters:
	 *     produces:
	 *       - application/json
	 *     responses:
	 *       200:
	 *         description: 获取数据列表
	 * */
    .post('/addShopWhite', DlyMenuController.addShopWhite)
    /**
	 * @swagger
	 * /dlyadminapi/menu/shopWhiteList:
	 *   get:
	 *     description: 店铺白名单列表
	 *     tags: [后台用户]
	 *     summary: "店铺白名单列表"
	 *     parameters:
	 *     produces:
	 *       - application/json
	 *     responses:
	 *       200:
	 *         description: 获取数据列表
	 * */
    .get('/shopWhiteList', DlyMenuController.shopWhiteList)
    /**
	 * @swagger
	 * /dlyadminapi/menu/rmShopWhite/:id:
	 *   get:
	 *     description: 删除白名单
	 *     tags: [后台用户]
	 *     summary: "删除白名单"
	 *     parameters:
	 *     produces:
	 *       - application/json
	 *     responses:
	 *       200:
	 *         description: 获取数据列表
	 * */
    .delete('/rmShopWhite/:id', DlyMenuController.rmShopWhite)

	

export default router
